Suspending Emacs (GNU Emacs Lisp Reference Manual) |
您所在的位置:网站首页 › selected suspend › Suspending Emacs (GNU Emacs Lisp Reference Manual) |
This function stops Emacs and returns control to the superior process. If and when the superior process resumes Emacs, suspend-emacs returns nil to its caller in Lisp. This function works only on the controlling terminal of the Emacs session; to relinquish control of other tty devices, use suspend-tty (see below). If the Emacs session uses more than one terminal, you must delete the frames on all the other terminals before suspending Emacs, or this function signals an error. See Multiple Terminals. If string is non-nil, its characters are sent to Emacs’s superior shell, to be read as terminal input. The characters in string are not echoed by the superior shell; only the results appear. Before suspending, suspend-emacs runs the normal hook suspend-hook. After the user resumes Emacs, suspend-emacs runs the normal hook suspend-resume-hook. See Hooks. The next redisplay after resumption will redraw the entire screen, unless the variable no-redraw-on-reenter is non-nil. See Refreshing the Screen. Here is an example of how you could use these hooks: (add-hook 'suspend-hook (lambda () (or (y-or-n-p "Really suspend?") (error "Suspend canceled")))) (add-hook 'suspend-resume-hook (lambda () (message "Resumed!") (sit-for 2)))Here is what you would see upon evaluating (suspend-emacs "pwd"): ---------- Buffer: Minibuffer ---------- Really suspend? y ---------- Buffer: Minibuffer ---------- ---------- Parent Shell ---------- bash$ /home/username bash$ fg ---------- Echo Area ---------- Resumed!Note that ‘pwd’ is not echoed after Emacs is suspended. But it is read and executed by the shell. |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |